//https://www.dotcpp.com/oj/contest6308_problem6.html
package 题目集.数学;

import java.util.Arrays;
import java.util.BitSet;
import java.util.Scanner;

public class 等差数列最少项 {
    /**
     * 思路：先排序，统计每项的差值，然后枚举公差，验证这些差值是否合法。
     * 此题不能二分，因为公差不具有单调性（即n-1）
     * 正解是通过最大公约数来求解。
     * 每一项与第一项的差一定是d的倍数，所以只要求出所有差的最大公约数即可。
     */
    static int n;
    static int[] diff;

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        n = sc.nextInt();
        int[] origin = new int[n];
        for (int i = 0; i < n; i++) {
            origin[i] = sc.nextInt();
        }
        Arrays.sort(origin);
        BitSet set = new BitSet();
        for (int i = 1; i < origin.length; i++) {
            set.set(origin[i] - origin[i - 1]);
        }
        diff = set.stream().toArray();
        if (diff.length == 1 && diff[0] == 0) {
            System.out.println(n);
            return;
        }
        int d = find();
        int res = (origin[n - 1] - origin[0]) / d + 1;
        System.out.println(res);
    }

    /**
     * 寻找最小公差
     */
    public static int find() {
        for (int i = diff.length - 1; i >= 0; i--) {
            if (check(diff[i])) {
                return diff[i];
            }
        }
        int n = diff[0] - 1;
        for (int i = n; i > 0; i--) {
            if (check(i)) {
                return i;
            }
        }
        return 1;
    }

    public static boolean check(int d) {
        for (int r : diff) {
            if (r % d != 0) {
                return false;
            }
        }
        return true;
    }
}
